import socket
import json
 
client_address = ('127.0.0.1', 31500)
server_address = ('127.0.0.1', 31501)
server_s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_s.bind(server_address)

while True:
    json_string, addr = server_s.recvfrom(2048)
    cmd = json.loads(json_string)
    print(cmd)

    server_s.sendto(bytes(json.dumps("FINISH"),'UTF-8'), client_address)

server_s.close()